/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bmf.ice;

import com.bmf.rest.Group;
import com.bmf.rest.Request;
import com.bmf.rest.nManagerLocal;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.ViewScoped;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;

/**
 *
 * @author Tony_
 */
@ManagedBean
@ViewScoped
@Stateless
public class bean {

    private DataModel model;
    private Request item;
    private String r;
    @EJB
    private nManagerLocal nManagerLocal;
    
    
    public bean() {
        
    }
    @PostConstruct
    public void start(){
        List<Request> list = nManagerLocal.getRequests();
        
        model = new ListDataModel(list);
    }

    public String view() {
        item = (Request) model.getRowData();
        return "view";
    }

    public DataModel getModel() {
        return model;
    }

    public Request getItem() {
        return item;
    }

    public String getR() {
        return r;
    }

}